package com.ouman.luoliluoli.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import com.ouman.luoliluoli.SplashActivity;

/**
 * Created by jintian on 29/05/2017.
 */

public class AppHelper {

    public static boolean appIsFirstRun(Context context){

        // 标记一下程序是否是第一次运行
        final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
        Boolean isFirstRun = preferences.getBoolean("isFirstRun", true);
        if (isFirstRun){
            SharedPreferences.Editor editor = preferences.edit();
            editor.putBoolean("isFirstRun", false);
            editor.apply();
            System.out.println("这是第一次运行");
            return true;
        }else {
            System.out.println("这不是不是不是第一次运行");
            return false;
        }
    }
}
